<?php
namespace Addons\Common\Controller;

    class CommonController extends \Common\Common\CommonController{
        //添加和编辑方法
        public  function  store(model $model,array $data,\Closure $callback=null){

            $res=$model->store($data);
            if($res && $callback instanceof \Closure){
                $callback($res);
            }
//            dd($res);die;
            $this->jump($res,'操作成功','操作失败');
        }

        //跳转方法
        protected function jump($res,$msg1,$msg2){
            if($res){
                $this->success($msg1,site_url('button/lists'));die;
            }else{
                $this->error($msg2);die;
            }
        }
    }